<!DOCTYPE html>
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<body>
<img id="image"
	srcset="resources/black.png 100w,
			resources/image-set-4x.png 1600w"
	sizes="100px"
>
<script>
    var t = async_test('Make sure that a sizes change also changes the intrinsic dimensions');
    window.onload = t.step_func(function() {

        var img = document.getElementById("image");
        img.onload = t.step_func(function() {
            assert_equals(img.width, 1600);
            img.onload = function(){};
            img.sizes = "100px";
            assert_equals(img.width, 100);
            t.done();
        });
        img.sizes = "1600px";
    });
</script>
</body>
</html>
